<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFriendshipTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//创建friendship表
		Schema::create('friendship', function($table)
		{
			$table->integer('user_id')->index('user_id');
			$table->integer('friend_id')->index('friend_id');
			$table->integer('type');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//删除friendship表
		Schema::dropIfExists('friendship');
	}

}
